<template>
	<view>
		<!-- 处方详情 -->
		<UserInfoCardVue></UserInfoCardVue>
		<u-tabs :list="listBar" :is-scroll="false" :current="current" @change="change"></u-tabs>
		<view class="pad-16r">
			<view class="item">
				<view class="border-col">就诊信息</view>
				<view>
					<view class="start-center">
						<view class="item-title">就诊医生:</view>
						<view>{{dataSource.doctorName}}({{dataSource.jobTitle}})</view>
					</view>
					<view class="start-center">
						<view class="item-title">就诊方式:</view>
						<view>{{dataSource.consultationTypeName}}</view>
					</view>
					<view class="start-center">
						<view class="item-title">就诊时间:</view>
						<view>{{dataSource.visitTime}}</view>
					</view>
					<view class="start-center">
						<view class="item-title">诊断结果:</view>
						<view>{{dataSource.visitResult}}</view>
					</view>
				</view>
			</view>
			<view v-if="current==0">
				<view class="item">
					<view class="border-col">处方信息</view>
					<view class="start-center">
						<view class="item-title">NO：</view>
						<view>{{dataSource.billNo}}</view>
					</view>
					<view v-for="(item,index) in dataSource.eBillInfo">
						<view class="mar-5-0">
							<view>{{item.name}}</view>
							<view class="between-center">
								<view class="guige">{{item.guige}}</view>
								<view class="">
									数量: {{item.num}} {{item.unit}}
								</view>
							</view>
						</view>
					</view>
					<view class="border-row"></view>
					<view class="between-center mar-15">
						<view class="start-center">
							<view>医师签名：</view>
							<view>
								<image class="qianming" src="/static/images/icon/qianming.png"></image>
							</view>
						</view>
						<view class="start-center">
							<view>医师签名：</view>
							<view>
								<image class="qianming" src="/static/images/icon/qianming.png"></image>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view v-if="current==1">
				<view class="item">
					<view class="border-col">药品邮寄</view>
					<ButtonVue content="去邮寄" @click="toPage(dataSource)"></ButtonVue>
				</view>
				<view class="item">
					<view class="border-col">用药指导</view>
					<view class="start-center">
						<view class="item-title">NO：</view>
						<view>{{dataSource.billNo}}</view>
					</view>
					<view v-for="(item,index) in dataSource.medical">
						<view class="mar-5-0">
							<view class="">{{item.name}}</view>
							<view class="guige">用法：{{item.yongfa}}</view>
						</view>
					</view>
					<view class="border-row"></view>

				</view>
			</view>
			<view v-if="current==2">
				<view class="item">
					<view class="border-col">检验检查</view>
					<view class="start-center">
						<view class="item-title">NO：</view>
						<view>{{dataSource.billNo}}</view>
					</view>
					<view v-for="(item,index) in dataSource.check">
						<view class="mar-5-0">
							<view>{{item.name}}</view>
							<view class="guige">申请单号：{{item.applyBillNo}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
	</view>
</template>

<script>
	import UserInfoCardVue from '../../../components/UserInfo/UserInfoCard.vue';
	import ButtonVue from '../../../components/Button/Button.vue';

	export default {
		components: {
			UserInfoCardVue,
			ButtonVue
		},
		data() {
			return {
				listBar: [{
					type: 1,
					name: "电子处方"
				}, {
					type: 2,
					name: "用药指导"
				}, {
					type: 3,
					name: "检验检查"
				}],
				current: 0,
				dataSource: {},
			}
		},
		onLoad(e) {
			this.dataSource = JSON.parse(e.item)
			this.init()
		},
		methods: {
			init(){
				
			},
			change(e) {
				this.current = e
			},
			toPage(item) {
				uni.navigateTo({
					url: '/pages/Home/ServePatient/MedicalRecordsEMS?item=' + JSON.stringify(this.dataSource)
				})
			},
		}
	}
</script>

<style scoped>
	.item {
		background-color: white;
		border-radius: 16rpx;
		margin: 10px 0;
		padding: 10px;
	}

	.item-title {
		color: #999999;
		margin-right: 10px;
		line-height: 30px;
	}

	.guige {
		color: #999999;
		margin-right: 10px;
		line-height: 30px;
	}

	.qianming {
		width: 80px;
		height: 30px;
	}
</style>